package com.ysyx.ysyx_driverinfo.controller;

import com.ysyx.ysyx_driverinfo.dto.BaseDto;
import com.ysyx.ysyx_driverinfo.pojo.DriverPojo;
import com.ysyx.ysyx_driverinfo.service.CarPojoService;
import com.ysyx.ysyx_driverinfo.service.impl.CarPojoServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by IntelliJ IDEA.
 *
 * @description: xxxx接口/类
 * @author:郭宇轩
 * @create:2023/4/14 10:32
 */
@RestController
@RequestMapping("/car")
public class CarController {

    @Autowired
    private CarPojoService carPojoService;

    /*
     * @Description: (作用)查询某个司机的车辆信息
     * @params: Integer driverId
     * @return:  状态101的baseDto BaseDto(101,"司机车辆查询成功",carList);
     *           状态201的baseDto BaseDto(201,"司机车辆不存在",null)
     * @Author: 郭宇轩
     * @create:2023/4/14
     */
    @RequestMapping(value = "/{driverId}",method = RequestMethod.GET)
    public BaseDto getCarByDriverId(@PathVariable Integer driverId){

        BaseDto baseDto = carPojoService.getCarByDriverId(driverId);

        return baseDto;
    }

    @RequestMapping("/reg")
    public String uploads(@RequestBody DriverPojo driverPojo){



        return null;
    }


}
